<?
/** 
 * Represents a service for storage. For example, store to filesystem, store to an online webservice, etc.
 */
abstract class bjImageStorage extends bjPlugin{
		
	function executeSave($params){
		//Execute save
 		$this->imageStorageSave($params);
 	}
	
	function executeLoad($params){
 		//Execute save
 		$this->imageStorageLoad($params);
 	}
		 
	/**
	 * Saves image data to the datastore.
	 * @param array $params
	 * @subparam String $params:data[i]->extension Image type (ie PNG, JPG)
	 * @subparam Mixed  $params:data[i]->data Raw image data reflecting the type
	 * @subparam String [$params:data[i]->version] 
	 * @subparam String [$params:data[i]->filename]
	 * @subparam String [$params:->preCallback[i]->className] Class (with method name) to call before save
	 * @subparam String [$params:->preCallback[i]->methodName] 
	 * @subparam String [$params:->postCallback[i]->className] Class (with method name) to call post save.
	 * @subparam String [$params:->postCallback[i]->methodName] 
	 * @subparam Integer $params:collaborator->collborator_id collaborator_id
	 * @return array $return
	 * @subreturn String [$return:status[i]->errorCode] Only include this if errors are present with msg
	 * @subreturn String [$return:status[i]->msg]
	 * @subreturn String $return:files[i]->filename Name of the file, including extension
	 * @subreturn String $return:files[i]->filePath Path the file is located in
	 * @subreturn String $return:files[i]->extension Extension of the file
	 * @subreturn String $return:files[i]->basename The filename without the extension
	 * @subreturn String $return:files[i]->url The full URL to the file, including filename	 	 
	 */
	abstract public function imageStorageSave($params);

	/**
	 * Returns back raw data for use with an applet
	 * @param array $params
	 * @subreturn String $params:files[i]->filename Name of the file, including extension
	 * @subreturn String $params:files[i]->filePath Path the file is located in
	 * @subreturn String $params:files[i]->extension Extension of the file
	 * @subreturn String $params:files[i]->basename The filename without the extension
	 * @return array $return
	 * @subreturn String $return:status[i]->errorCode
	 * @subreturn String $return:status[i]->msg
	 * @subreturn String $return:files[i]->filePath Path the file is located in
	 * @subreturn String $return:files[i]->extension Extension of the file
	 * @subreturn String $return:files[i]->basename The filename without the extension
	 * @subreturn String $params:files[i]->filename Name of the file, including extension
	 * @subreturn String $params:files[i]->data Raw data associated with the file	 	 
	 */
	abstract public function imageStorageLoad($params);
	
}